<%@page contentType="text/html;charset=UTF-8"%>
<%@page import="util.PubFun"%>
<%@page import="javabean.UserInfo"%>
<%UserInfo userInfo = (UserInfo)session.getAttribute("userInfo");
if(userInfo == null) {%>
<script type="text/javascript">
	parent.location=rootUrl+"/sign_in.jsp";
</script>
<%	return;		
}
String content = (String)request.getAttribute("content");
if(content==null){
	content = "";
}else{
	content = PubFun.getHtmlFilterValue(content);
}%>
<script type="text/javascript" src="<%=request.getContextPath()%>/fckeditor/fckeditor.js"></script>
	<script language="javascript">
		var oFCKeditor=new FCKeditor("FCKeditor1") ;
		oFCKeditor.BasePath="<%=request.getContextPath()%>/fckeditor/";
		oFCKeditor.Height='100%';
		oFCKeditor.Width='100%';
		oFCKeditor.Value='<%=content%>';
		oFCKeditor.ToolbarSet='Default'
		oFCKeditor.Create();
		function FCKeditor_OnComplete(editorInstance) {
		  parent.contiueAll();
		  FCKeditorAPI.GetInstance('FCKeditor1').Commands.GetCommand('FitWindow').Execute();
		  if(parent.document.getElementById('article_info_div')){
		  	  parent.document.getElementById('article_info_div').style.display='none';
		  }
		}
		var fckContent='';
		var index='';		
		function getDate(){
			var oEditor = FCKeditorAPI.GetInstance('FCKeditor1');
			fckContent = filter(oEditor.GetXHTML(true));
			index = getPureData(fckContent);
		}
		function getPureData(data) {
	        data=data.replace(/<br[\s\/]{0,2}>/ig,"\r\n");
	        data=data.replace(/<.*?>/ig,"");
	        data=data.replace(new RegExp("&nbsp;","g")," ");
	        data=data.replace(new RegExp("&lt;","g"),"<");
	        data=data.replace(new RegExp("&gt;","g"),">");
	        data=data.replace(new RegExp("&amp;","g"),"&");
	        return data;
	    }
		function filter(str){
			return str.replace(/<script|<\/script|<frame|<\/frame|<iframe|<object|<embed|javascript:|onload=|onbeforeunload/ig, "");
		}
		function setContent(text){
			var oEditor=FCKeditorAPI.GetInstance('FCKeditor1') ;
			oEditor.SetHTML(text) ;
		}
	</script>
	